package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ttao
 * @since 2023/4/24 16:36
 */

@Mapper
public interface DishFlavorMapper {
    /**
     * 向菜品口味关系表 批量插入口味数据
     *
     * @param dishFlavorList
     * @return
     */
    int insertBatch(List<DishFlavor> dishFlavorList);

    /**
     * 根据菜品id删除关联的口味数据
     *
     * @param dishIds
     * @return
     */
    int deleteByDishIds(List<Long> dishIds);

    /**
     * 根据id查询菜品关联的口味
     *
     * @return
     */
    @Select("select * from dish_flavor where dish_id=#{dishId}")
    List<DishFlavor> selectByDishId(Long dishId);
}
